﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ClientSocket
{
    public partial class Form_UseId : Form
    {
        public Form_UseId()
        {
            InitializeComponent();
        }
        public string userId;
        private void Form_UseId_Load(object sender, EventArgs e)
        {
            this.Text = "请输入转发对象用户ID";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ReturnEvent();
        }

        private void ReturnEvent()
        {
            if (this.textBox1.Text != null && this.textBox1.Text.Length > 0)
            {
                this.userId = this.textBox1.Text;
                this.DialogResult = DialogResult.OK;
            }
            else
                MessageBox.Show("请输入转发对象用户ID!");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                ReturnEvent();
        }
    }
}
